#!/bin/sh

server="10.0.3.2"

uci get drcom.config.enable || exit 0

while :
do
    sleep 3
    echo "Test connectivity to auth server"
    ping -c1 $server
    if [ $? != 0 ]
    then
        echo "ping failed, retry"
        logger -t drcom "ping failed, retry"
    else
        echo "OK"
        logger -t drcom "ping OK"
        break
    fi
done

exec python /bin/drcom.py